#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
void times(int input,int shi,int feng,int miao)
{
   shi =input/3600;
   feng =(input -shi*3600)/60;
   miao =(input -shi*3600-feng*60);
   printf("%d ",shi);
   printf("%d ",feng);
   printf("%d",miao);
}
int main()
{
  int input = 0;
  int miao = 0;
  int feng = 0;
  int shi = 0;
  scanf("%d",&input);
  times(input,shi,feng,miao);
  return 0;
}